package com.dragon.common.modules.uaa.web.models.params;

import io.swagger.v3.oas.annotations.media.Schema;
import jakarta.validation.constraints.NotBlank;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.io.Serializable;
import java.util.Arrays;
import java.util.List;

/**
 * @author Chris Chan
 * Create On 2025/8/8 下午11:25
 * Use for:
 * Explain:
 */
@Data
@NoArgsConstructor
@AllArgsConstructor
@Schema(description = "更新账号角色参数")
public class UpdateAccountRoleParam implements Serializable {
    private static final long serialVersionUID = 1L;
    @NotBlank(message = "账号编码不能为空")
    @Schema(description = "账号编码", example = "12345678")
    private Long accountCode;
    @NotBlank(message = "角色编码不能为空")
    @Schema(description = "角色编码")
    private List<Long> roleCodes;

    public static UpdateAccountRoleParam of(Long accountCode, List<Long> roleCodes) {
        return new UpdateAccountRoleParam(accountCode, roleCodes);
    }

    public static UpdateAccountRoleParam of(Long accountCode, Long... roleCodes) {
        return new UpdateAccountRoleParam(accountCode, Arrays.asList(roleCodes));
    }

    public static UpdateAccountRoleParam create(Long accountCode, List<Long> roleCodes) {
        return new UpdateAccountRoleParam(accountCode, roleCodes);
    }

    public static UpdateAccountRoleParam create(Long accountCode, Long... roleCodes) {
        return new UpdateAccountRoleParam(accountCode, Arrays.asList(roleCodes));
    }

}
